<?php
namespace App\Service\Admin;

use App\Service\BaseService as Service;

class BaseService extends Service
{
    //基础服务

    //通过token获取管理员
    public function adminByToken($token)
    {
        $logOne = (array) $this->dbConn($this->dbAdmLogin)
            ->where('token', $token)
            ->orderBy('id', 'desc')
            ->first();
        if (empty($logOne)) { return ''; }
        return (array) $this->dbConn($this->dbAdmin)
            ->where('id', $logOne['adminid'])
            ->first();
    }
}